package cn.rumoss.jvm.deep.oom;

/**
 * -Xss128k 设置每个线程的堆栈大小，值越小，线程数量越多
 * The stack size specified is too small, Specify at least 228k
 * -Xss228k
 * @author xiaotang
 *
 */
public class VMStackSOF {
	
	private int stackLen = 1;
	
	public void stackLeak() {
		stackLen++;
		stackLeak();
	}

	public static void main(String[] args) {

		VMStackSOF sof = new VMStackSOF();
		try {
			sof.stackLeak();
		} catch (Throwable t) {
			System.out.println("Stack length: " + sof.stackLen);
			throw t;
		}
		
	}

}
